 export default function (e) {
    if($page.state.isclick) {
        $page.state.isclick = false
        return
    } 
    // 滚动距离顶部
    let scrollTop = e.event.detail.scrollTop;
    // 滚动总高度
    let scrollHeight = e.event.detail.scrollHeight
    // 滚动容器高度
    let wHeight = 0

    const query = wx.createSelectorQuery()
    // 获取父容器的高度
    query.select(`#uuid_de963015`).boundingClientRect((res) =>{
        // 高度
        wHeight = res.height
    });

    clearTimeout($page.state.timeOut)

    // 滑动显示导航栏
    scrollTop >= 15 ? $page.state.isNav = true : $page.state.isNav = false
    $page.state.timeOut = setTimeout(()=>{
       query.selectAll(`.nav-container`).boundingClientRect((rs) => {
            rs.forEach((item)=>{
                if((item.top - 30) <= $page.state.top){ 
                    // 切换分类active
                    $page.handler.handlerCurrent(item);
                }
                else if ( wHeight + scrollTop == scrollHeight) { // 判断滚动到底部
                    // 切换分类active
                    $page.handler.handlerCurrent(item);
                }

            });
        }).exec()
    },300)
}
